<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/appjs/enterprise/enterpriseMember/enterpriseMember.js"></script>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return'<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>企业会员</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>共享余额</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back()"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });

</script>

<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <div class="columns pull-left">
                        <h5 class="font-bold">共享余额</h5>
                    </div>
                    <div class="ibox-tools">
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>

                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="frmSubmemberShare">
                        <input type="hidden" name="memberId" id="memberId" value="${memberId}">
                        <div class="form-group row">
                            <label class="col-sm-3  text-right">是否启用共享余额：</label>
                            <div class="col-sm-6">
                                <select class="form-control" id="status" name="status">
                                    <option value="0"
                                            <c:if test="${submemberShare.status eq '0'}">selected</c:if>   >否
                                    </option>
                                    <option value="1"
                                            <c:if test="${submemberShare.status eq '1'}">selected</c:if>   >是
                                    </option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group row" id="mobileDiv">
                            <label class="col-sm-3 col-form-label text-right">生效时间：</label>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" id="beginTime" name="beginTime" readonly
                                       placeholder="请选择开始时间"
                                       value="<fmt:formatDate value="${submemberShare.beginTime}" pattern="yyyy-MM-dd HH:mm:ss" />">
                            </div>
                            至
                            <div class="col-sm-2">
                                <input type="text" class="form-control" id="endTime" name="endTime" readonly
                                       placeholder="请选择结束时间"
                                       value="<fmt:formatDate value="${submemberShare.endTime}" pattern="yyyy-MM-dd HH:mm:ss" />">
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">充电量限额/日：</label>
                            <div class="col-sm-6">
                                <div class="input-group m-b"><input type="text" name="fixedPower" id="fixedPower"
                                                                    class="form-control"
                                                                    value="${submemberShare.fixedPower - submemberShare.sharePower}"> <span
                                        class="input-group-addon">度</span></div>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">授权类型：</label>
                            <div class="col-sm-3">
                                <select class="form-control" name="shareType" id="shareType">
                                    <option value="0"
                                            <c:if test="${submemberShare.shareType eq '0'}">selected</c:if>  >每日授权
                                    </option>
                                    <option value="1"
                                            <c:if test="${submemberShare.shareType eq '1'}">selected</c:if>   >每周授权
                                    </option>
                                    <option value="2"
                                            <c:if test="${submemberShare.shareType eq '2'}">selected</c:if>  >每月授权
                                    </option>
                                </select>
                            </div>
                            <div class="col-sm-3">
                                <div class="input-group m-b"><input type="text" name="fixedAccount" id="fixedAccount"
                                                                    class="form-control" value="${submemberShare.fixedAccount - submemberShare.shareAccount}"> <span
                                        class="input-group-addon">元</span></div>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-3 col-sm-offset-8 text-right">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        var beginTime = laydate.render({
            elem: '#beginTime',
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm:ss',
            trigger: 'click',
            done: function (value, dates) {
                endTime.config.min = {
                    year: dates.year,
                    month: dates.month - 1, //关键
                    date: dates.date,
                    hours: 0,
                    minutes: 0,
                    seconds: 0
                };
            }
        });
        var endTime = laydate.render({
            elem: '#endTime',
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm:ss',
            trigger: 'click'
        });

    });


    addSubmemberShare.init();
</script>
</body>
</html>
